import request from '@/utils/request';

// 获取登录用户信息
export async function fetchUser() {
  return request('/api/platform/getLoginUserInfo', {
    method: 'GET',
    params: {},
  });
}

// 登陆
export async function login(data: { username: string; password: string }) {
  return request('/api/platform/mainLand', {
    method: 'POST',
    data,
  });
}

// 获取验证码
export async function getCapture(data: { phone: string }) {
  return request('/api/sendMessage', {
    method: 'POST',
    data,
  });
}

// 忘记密码获取验证码
export async function sendResetPwdSms(data: { account: string }) {
  return request('/api/platform/sendResetPwdSms', {
    method: 'POST',
    data,
  });
}

// 忘记密码获取验证码
export async function resetPwd<T>(data: T) {
  return request('/api/platform/resetPwd', {
    method: 'POST',
    data,
  });
}




export async function sendCode<T>(data: T) {
  return request('/api/normal/sendCode', {
    method: 'POST',
    data,
  });
}

export async function loginByMobile<T>(data: T) {
  return request('/api/normal/loginByMobile', {
    method: 'POST',
    data,
  });
}